//#define _CRTDBG_MAP_ALLOC
#include "StdAfx.h"
#include "EarthMoverDistance.h"


EarthMoverDistance::EarthMoverDistance(void)
{  
    



}

float EarthMoverDistance::calcEMD2(Frame* frameOne, Frame* frameTwo)
{
    this->frameOne = frameOne;
    this->frameTwo = frameTwo;
    
   /* CvHistogram* histOne =this->frameOne->getHistogram();
    CvHistogram* histTwo =this->frameTwo->getHistogram();*/
    this->frameOne->getHistogram();
    this->frameTwo->getHistogram();
    
    CvMat* signatureOne=this->frameOne->getSignature();
    CvMat* signatureTwo=this->frameTwo->getSignature();
    
    float emd = cvCalcEMD2(signatureOne,signatureTwo,CV_DIST_L2);
    return emd;
}


EarthMoverDistance::~EarthMoverDistance(void)
{
   // delete frameOne;
    // delete frameTwo;
}